#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

#include "Primitive.h"



BEGIN_ENUM(PrimitiveType)
    Unknown = -1, Sphere, Cube, Cylinder
END_ENUM(PrimitiveType)


class PrimitiveFactory
{
public:
    
    static void write(std::wostream & os, const Primitive& shape);
    static ref<Primitive> read(std::wistream & is);

    // ************************************************************************

    static ref<Primitive> primitiveFromName(const std::string& name);
    static std::string nameFromPrimitive(const Primitive& shape);

    // ************************************************************************

    static PrimitiveType primitiveToType(const Primitive& shape);
    static ref<Primitive> primitiveFromType(PrimitiveType type);

    // ************************************************************************

    static PrimitiveType nameToType(const std::string& name);
    static std::string typeToName(PrimitiveType type);

private:

    PrimitiveFactory();

};
